<template>
  <a-card :bordered="false">
    <div class="content">
      <mms-material-info-list v-if="currentTab === 0" @nextStep="nextStep"></mms-material-info-list>
      <mms-material-info-details-list :status="materFilter.status" :id="materFilter.id" v-if="currentTab === 1" @nextStep="nextStep" @prevStep="prevStep"></mms-material-info-details-list>
    </div>
  </a-card>
</template>
<script>
  import MmsMaterialInfoList from './MmsMaterialInfoList'
  import MmsMaterialInfoDetailsList from './MmsMaterialInfoDetailsList'
  export default {
    name: 'MmsMaterialInfoMain',
    mixins: [],
    components: {
      MmsMaterialInfoList,
      MmsMaterialInfoDetailsList
    },
    data () {
      return {
        currentTab: 0,
        materFilter:{
          status:"",
          id:"",
        },
      }
    },
    methods: {
      // handler
      nextStep (filterObj) {
        this.materFilter.status = filterObj.status
        this.materFilter.id = filterObj.id
        if (this.currentTab < 2) {
          this.currentTab += 1
        }
      },
      prevStep () {
        if (this.currentTab > 0) {
          this.currentTab -= 1
        }
      },
    },
  }
</script>